package com.engineering.elink.util.data;

public class Format {
	/**
	 * 验证用户名格式
	 * @param username
	 * @return boolean
	 */
	public static boolean checkUsername (String username) {
		if (username != null && username.length() >= 4 && username.length() <= 20) {
			return true;
		}
		return false;
	}
	
	/**
	 * 验证手机号格式
	 */
	public static boolean checkPhone (String phone) {
		if (phone != null && phone.length() == 11) {
			return true;
		}
		return false;
	}
	
	/**
	 * 验证邮箱格式
	 */
	public static boolean checkEmail (String email) {
		if (email != null) {
			return true;
		}
		return false;
	}
	
	/**
	 * 验证验证码格式(注册)
	 */
	public static boolean checkVerifyCode (String verifyCode) {
		if (verifyCode != null && verifyCode.length() == 4) {
			return true;
		}
		return false;
	}
	
}
